3.207 \(\int \frac {\sec (x)}{\cot (x)+\csc (x)} \, dx\)

Optimal. Leaf size=11 \[ \log (\cos (x)+1)-\log (\cos (x)) \]

[Out]

-ln(cos(x))+ln(1+cos(x))

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {4392, 2707, 36, 29, 31} \[ \log (\cos (x)+1)-\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]/(Cot[x] + Csc[x]),x]

[Out]

-Log[Cos[x]] + Log[1 + Cos[x]]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2707

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^(m - (p + 1)/2))/(a - x)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rule 4392

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {\sec (x)}{\cot (x)+\csc (x)} \, dx &=\int \frac {\tan (x)}{1+\cos (x)} \, dx\\ &=-\operatorname {Subst}\left (\int \frac {1}{x (1+x)} \, dx,x,\cos (x)\right )\\ &=-\operatorname {Subst}\left (\int \frac {1}{x} \, dx,x,\cos (x)\right )+\operatorname {Subst}\left (\int \frac {1}{1+x} \, dx,x,\cos (x)\right )\\ &=-\log (\cos (x))+\log (1+\cos (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.01, size = 25, normalized size = 2.27 \[ 2 \log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (1-2 \cos ^2\left (\frac {x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/(Cot[x] + Csc[x]),x]

[Out]

2*Log[Cos[x/2]] - Log[1 - 2*Cos[x/2]^2]

________________________________________________________________________________________

fricas [A]  time = 1.05, size = 15, normalized size = 1.36 \[ -\log \left (-\cos \relax (x)\right ) + \log \left (\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(cot(x)+csc(x)),x, algorithm="fricas")

[Out]

-log(-cos(x)) + log(1/2*cos(x) + 1/2)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 12, normalized size = 1.09 \[ \log \left (\cos \relax (x) + 1\right ) - \log \left ({\left | \cos \relax (x) \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(cot(x)+csc(x)),x, algorithm="giac")

[Out]

log(cos(x) + 1) - log(abs(cos(x)))

________________________________________________________________________________________

maple [A]  time = 0.09, size = 6, normalized size = 0.55 \[ \ln \left (1+\sec \relax (x )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)/(cot(x)+csc(x)),x)

[Out]

ln(1+sec(x))

________________________________________________________________________________________

maxima [B]  time = 0.33, size = 29, normalized size = 2.64 \[ -\log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right ) - \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(cot(x)+csc(x)),x, algorithm="maxima")

[Out]

-log(sin(x)/(cos(x) + 1) + 1) - log(sin(x)/(cos(x) + 1) - 1)

________________________________________________________________________________________

mupad [B]  time = 0.66, size = 11, normalized size = 1.00 \[ -\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)*(cot(x) + 1/sin(x))),x)

[Out]

-log(tan(x/2)^2 - 1)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec {\relax (x )}}{\cot {\relax (x )} + \csc {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(cot(x)+csc(x)),x)

[Out]

Integral(sec(x)/(cot(x) + csc(x)), x)

________________________________________________________________________________________